Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid garbage references when DNS resolution rejects on legacy PHP <= 5.6 #133

Merged
merged 1 commit into from
Jul 10, 2019

Conversation

clue
Copy link
Member

@clue clue commented Jul 10, 2019

These garbage references only show up when a DNS lookup rejects with an
Exception on legacy PHP <= 5.6. These issues have been fixed upstream in
the Promise component for current PHP versions with
https://github.com/reactphp/promise/releases/tag/v2.6.0 but this PR
explicitly unsets known garbage references to avoid unexpected memory
growth on legacy PHP versions.

The downstream Socket component implicitly depends on this because its
test suite currently fails. This changeset can be considered a new
feature in this component which fixes a bug in the test suite of a
downstream component.

Accordingly to the roadmap (#128) we planned to stop the v0.4.x series, but I consider this to be a notable issue that warrants a v0.4.19 release. Once accepted, I will manually merge this into the current master branch targeting the upcoming v1.0.0 milestone.

Builds on top of #125 and #129
Refs #118

@clue clue added this to the v0.4.19 milestone Jul 10, 2019
@clue clue requested review from jsor and WyriHaximus July 10, 2019 12:19
@clue clue changed the title Avoid garbage references when resolving rejects on legacy PHP <= 5.6 Avoid garbage references when DNS resolution rejects on legacy PHP <= 5.6 Jul 10, 2019
@clue
Copy link
Member Author

clue commented Jul 10, 2019

For the reference: I've verified this actually fixes the build error for the downstream socket component (https://travis-ci.org/reactphp/socket/builds/556729141) by applying this version manually:

# composer.json.patch
{
    "require": {
        "react/dns": "dev-legacy-garbage as 0.4.19"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/clue/dns"
        }
    ],
    "config": {
        "platform": {
            "php": "5.6.30"
        }
    }
}
$ cd ~/workspace/reactphp-socket
$ composer update
$ docker run --rm -it -v `pwd`:/data --entrypoint=vendor/bin/phpunit --workdir=/data php:5.6

In other words: Once this PR is in and tagged as v0.4.19, the upstream component will build just fine again without any modification 👍

These garbage references only show up when a DNS lookup rejects with an
Exception on legacy PHP <= 5.6. These issues have been fixed upstream in
the Promise component for current PHP versions with
https://github.com/reactphp/promise/releases/tag/v2.6.0 but this PR
explicitly unsets known garbage references to avoid unexpected memory
growth on legacy PHP versions.

The downstream Socket component implicitly depends on this because its
test suite currently fails. This changeset can be considered a new
feature in this component which fixes a bug in the test suite of a
downstream component.
@clue clue force-pushed the legacy-garbage branch from 8e8d861 to e6cb8d8 Compare July 10, 2019 12:31
@jsor jsor merged commit ba897d4 into reactphp:0.4 Jul 10, 2019
@clue clue deleted the legacy-garbage branch July 10, 2019 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants